{extend name="admin@public/base" /}
{block name="main-content"}
<div class="page-content">
    <link rel="stylesheet" type="text/css" media="all" href="__PUBLIC__/sldate/daterangepicker-bs3.css"/>
    <form name="" class="" id="list-filter" method="post" action="{:url('admin/Task/issue_list')}">
        <div class="row">
            <div class="col-xs-12 col-sm-12 maintop">
                <select name="youxjb" class="ajax_change2">
                    <option value="">优先级</option>
                    <option value="">全部</option>
                    {foreach ztlist as $k=>$v}{if $v['fenlbm'] == '优先级'}
                    <option value="{$v['daimid']}">{$v['daimmc']}</option>
                    {/if}{/foreach}
                </select>
                <select name="zhuangt" class="ajax_change2">
                    <option value="">当前状态</option>
                    <option value="">全部</option>
                    {foreach ztlist as $k=>$v}{if $v['fenlbm'] == '当前状态'}
                    <option value="{$v['daimid']}">{$v['daimmc']}</option>
                    {/if}{/foreach}
                </select>
                <select name="biaoz" class="ajax_change2" id="biaoz">
                    <option value="">状态标志</option>
                    <option value="0">全部</option>
                    <option value="">未关闭任务</option>
                    {foreach ztlist as $k=>$v}{if $v['fenlbm'] == '状态标志'}
                    <option value="{$v['daimid']}">{$v['daimmc']}</option>
                    {/if}{/foreach}
                </select>
                <select name="jied" class="ajax_change2">
                    <option value="">当前阶段</option>
                    <option value="">全部</option>
                    {foreach ztlist as $k=>$v}{if $v['fenlbm'] == '当前阶段'}
                    <option value="{$v['daimid']}">{$v['daimmc']}</option>
                    {/if}{/foreach}
                </select>
                <select name="renwlx" class="ajax_change2">
                    <option value="">任务类型</option>
                    <option value="">全部</option>
                    {foreach ztlist as $k=>$v}{if $v['fenlbm'] == '任务类型'}
                    <option value="{$v['daimid']}">{$v['daimmc']}</option>
                    {/if}{/foreach}
                </select>
                <select name="fabry" class="ajax_change2" id="select-2">
                    <option value="">提出人员</option>
                    {foreach admin_list as $k=>$v}
                    <option value="{$v['admin_id']}">{$v['admin_realname']}</option>
                    {/foreach}
                </select>
                <select name="jiedfzr" class="ajax_change2" id="select-3">
                    <option value="">阶段负责人</option>
                    <option value="">全部</option>
                    {foreach admin_list as $k=>$v}
                    <option value="{$v['admin_id']}">{$v['admin_realname']}</option>
                    {/foreach}
                </select>
                <select name="cp" class="ajax_change2">
                    <option value="">选择产品</option>
                    <option value="">全部</option>
                    {foreach cp_list as $k=>$v}
                    <option value="{$v['chanpid']}">{$v['chanpmc']}</option>
                    {/foreach}
                </select>
                <select name="xm" class="ajax_change2">
                    <option value="">选择项目</option>
                    <option value="">全部</option>
                    {foreach xm_list as $k=>$v}
                    <option value="{$v['xiangmid']}">{$v['xiangmmc']}</option>
                    {/foreach}
                </select>
                <select name="renwu" class="ajax_change2" id="myrenwu">
                    <option value="">任务选择</option>
                    <option value="">全部</option>
                    <option value="0">我的任务</option>
                    <option value="1">我未接收的任务</option>
                    <option value="2">我已接收的任务</option>
                    <option value="3">我分配的任务</option>
                </select>
                <!-- <select name="px" class="ajax_change2">
                     <option value="">问题排序</option>
                     <option value="">默认排序</option>
                     <option value="4">优先级排序</option>
                     <option value="5">预计时间排序</option>
                     <option value="6">更新时间排序</option>
                     <option value="7">完成时间排序</option>
                 </select>-->
                <div class="col-xs-3 col-sm-3 wentilb" style="">
                    <table class="table table-bordered">
                        <tbody>
                        <tr class="active">
                            <th>任务</th>
                            <th id="sum">{$sum}个</th>
                        </tr>
                        <tr class="active">
                            <th>解决任务</th>
                            <th id="jj">{$jj}个</th>
                        </tr>
                        <tr class="active">
                            <th>未解决任务</th>
                            <th id="wjj">{$wjj}个</th>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>

            <div class="col-xs-11 col-sm-3 hidden-xs btn-sespan">
                <div class="input-group">
										<span class="input-group-addon">
											<i class="glyphicon glyphicon-calendar fa fa-calendar"></i>
										</span>
                    <input type="text" name="reservation" id="reservation" class="sl-date" value=""
                           placeholder="点击选择日期范围"/>
                </div>
            </div>

            <div class="col-xs-10 col-sm-5 btn-sespan chaxun1">
                <div class="input-group">
									<span class="input-group-addon">
										<i class="ace-icon fa fa-check"></i>
									</span>
                    <input type="text" name="key" id="key" class="form-control search-query admin_sea" value="" placeholder="输入需查询的任务标题、支持模糊查询"/>
                    <span class="input-group-btn">
                        <button type="submit" class="btn btn-xs btm-input btn-purple ajax-search-form">
                            <span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
                            搜索
                        </button>
					</span>
                </div>
            </div>
        </div>
    </form>
    <div class="row  maintop">
        <div class="col-xs-12 col-sm-12">
            <a href="{:url('admin/Task/issue_add')}">
                <button type="button" class="btn btn-xs btn-danger">
                    <i class="ace-icon fa fa-bolt bigger-110"></i>
                    添加任务
                </button>
            </a>
            <a href="{:url('admin/Task/issue_list',array('fabry'=>session('admin_auth.aid')))}">
                <button type="button" class="btn btn-xs btn-success">
                    <i class="ace-icon fa fa-tasks bigger-110"></i>
                    我发布的任务
                </button>
            </a>
            <a href="{:url('admin/Task/issue_list',array('renwu'=>0))}">
                <button type="button" class="btn btn-xs btn-success">
                    <i class="ace-icon fa fa-tasks bigger-110"></i>
                    我的任务(不包含发布)
                </button>
            </a>
            <a href="{:url('admin/Task/issue_list',array('renwu'=>2))}">
                <button type="button" class="btn btn-xs btn-success">
                    <i class="ace-icon fa fa-recycle bigger-110"></i>
                    我已接收的任务
                </button>
            </a>
            <a href="{:url('admin/Task/issue_list',array('renwu'=>1))}">
                <button type="button" class="btn btn-xs btn-success">
                    <i class="ace-icon fa fa-external-link bigger-110"></i>
                    我未接收的任务
                </button>
            </a>
            <a href="{:url('admin/Task/issue_list',array('renwu'=>3))}">
                <button type="button" class="btn btn-xs btn-success">
                    <i class="ace-icon fa fa-share-square-o bigger-110"></i>
                    我参与过的任务
                </button>
            </a>
            <!--<a href="{:url('admin/Task/task_log')}">
                <button type="button" class="btn btn-xs btn-success">
                    <i class="ace-icon fa fa-history bigger-110"></i>
                    我参与过的任务记录
                </button>
            </a>-->
            <a href="{:url('admin/Task/issue_list',array('update'=>6))}">
                <button type="button" class="btn btn-xs btn-yellow">
                    <i class="ace-icon fa fa-sort-amount-desc bigger-110"></i>
                    更新时间排序
                </button>
            </a>
            <a href="{:url('admin/Task/issue_list')}">
                <button type="button" class="btn btn-xs btn-yellow">
                    <i class="ace-icon fa fa-sort-amount-desc bigger-110"></i>
                    默认排序
                </button>
            </a>
        </div>
    </div>
    <div class="row">
        <div class="col-xs-12">
            <div>
                <form id="alldel" name="alldel" method="post" action="{:url('admin/Task/issue_list')}" >
                    <div class="table-responsive">
                        <table id="issueTable" class="table table-striped table-bordered table-hover ">
                            <thead>
                            <tr>
                                <th class="hidden-xs">编号</th>
                                <th>任务标题</th>
                                <th class=""><a href="{:url('admin/Task/issue_list',array('yxjb'=>1))}" class="ajax_change3">优先级别</a></th>
                                <th class="">当前状态</th>
                                <th class="">状态标志</th>
                                <th class="">当前阶段</th>
                                <th class="">任务类型</th>
                                <th class="">提出人员</th>
                                <th class=""><a href="{:url('admin/Task/issue_list',array('jiedfzr1'=>1))}">阶段负责人</a></th>
                                <th class=""><a href="{:url('admin/Task/issue_list',array('fabsj'=>1))}">发布时间</a></th>
                                <th class=""><a href="{:url('admin/Task/issue_list',array('jiedyjwcsj'=>1))}">本阶段预计完成时间</a></th>
                                <th class=""><a href="{:url('admin/Task/issue_list',array('yaoqwcsj'=>1))}">要求完成时间</a></th>
                                <th class=""><a href="{:url('admin/Task/issue_list',array('cpmc'=>1))}">产品名称</a></th>
                                <th class=""><a href="{:url('admin/Task/issue_list',array('xmmc'=>1))}">项目名称</a></th>
                                <th class="">模块名称</th>
                            </tr>
                            <script>
                                //获取url地址，判断是否有数字，如果有则再次点击则返回上一个页面
                                $("#issueTable a").click(function(e){
                                    var url = window.location;
                                    var ret = /[\d]+\.html/;
                                    if(ret.test(url)){
                                        window.location.href = "{:url('admin/Task/issue_list')}";
                                        return false;
                                    }
                                });
                            </script>
                            </thead>
                            <tbody id="ajax-data">
                            {include file="task/ajax_issue_list"/}
                            </tbody>
                            <tbody>
                            <tr id="daochu">
                                <td colspan="7" align="right">任务导出</td>
                                <td colspan="1" align="right"><a class="green" href="{:url('admin/Task/issue_excel')}" title="导出到Excel"><i class="ace-icon fa fa-share bigger-130"></i></a></td>
                                <td colspan="7" align="right"></td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div><!-- /.page-content -->
{/block}
{block name="scripts"}
<script type="text/javascript" src="__PUBLIC__/sldate/moment.js"></script>
<script type="text/javascript" src="__PUBLIC__/sldate/daterangepicker.js"></script>
<script type="text/javascript">
    $('#reservation').daterangepicker(null, function (start, end, label) {
        console.log(start.toISOString(), end.toISOString(), label);
    });
    $("#select-2").select2({
        placeholder: "提出人员",
        allowClear:true,
    });
    $("#select-3").select2({
        placeholder: "阶段负责人",
        allowClear:true,
    });
    $(".select2-selection__clear").html('');
    $.fn.modal.Constructor.prototype.enforceFocus = function() {}; //重新获取焦点
</script>
{/block}